{% include data.html %}
{% assign urlparts = page.url|split:"/" %}
{% assign orgname = urlparts[2] %}
{% assign ourpids = pids|where:"owner",orgname %}
<!DOCTYPE html>
<html>
{% include head.html %}
<body class="{% if site.animated %}animated fade-in-down{% endif %}">
  <div class="site-wrap">
    {% include header.html %}

    <div class="post p2 p-responsive wrap" role="main">
      <div class="measure">
        <div class="post">
          <header class="post-header">
            <h1 class="h2">{{page.title|xml_escape}}</h1>
          </header>
          <article class="post-content">
            {% if page.site %}
            <table>
                <tr><th>Site</th><td><a href="{{page.site}}">{{page.site|xml_escape}}</a></td></tr>
            </table>
            {% endif %}

            {{ content }}

            <h2>Allocated PIDs</h2>
              <table>
                <thead>
                  <tr><th>VID</th><th>PID</th><th>Device</th></tr>
                </thead>
                {% for pid in ourpids %}
                  {% assign pidurlparts = pid.url|split:"/" %}
                  <tr>
                    <th><a href="/{{pidurlparts[1]}}/">{{pidurlparts[1]}}</a></th>
                    <th><a href="{{pid.url}}">{{pidurlparts[2]}}</a></th>
                    <td>{{page.title|xml_escape}} {{pid.title|xml_escape}}</td>
                  </tr>
                {% endfor %}
              </table>
          </article>
        </div>
      </div>
    </div>
  </div>

  {% include footer.html %}
</body>
</html>
